package com.zg.nacos.domain.vo;

import com.zg.common.core.vo.BaseVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Map;

/**
 * <p>Description: </p>
 *
 * @author zhanfeng.liang
 * @since 2025/6/24 11:13
 */
@ApiModel(value = "Nacos服务实例信息", description = "描述Nacos注册中心中的服务实例详细信息")
@Data
public class InstanceVo extends BaseVo {

    @ApiModelProperty(value = "实例ID，格式为: IP#端口#集群#组名@@服务名", example = "192.168.1.100#8080#DEFAULT#DEFAULT_GROUP@@my-service")
    private String instanceId;

    @ApiModelProperty(value = "实例IP地址", example = "192.168.1.100")
    private String ip;

    @ApiModelProperty(value = "实例端口", example = "8080")
    private int port;

    @ApiModelProperty(value = "实例权重，用于负载均衡", example = "1.0")
    private double weight;

    @ApiModelProperty(value = "实例健康状态", example = "true")
    private boolean healthy;

    @ApiModelProperty(value = "实例是否启用", example = "true")
    private boolean enabled;

    @ApiModelProperty(value = "实例是否为临时实例", example = "true")
    private boolean ephemeral;

    @ApiModelProperty(value = "实例所属集群名称", example = "DEFAULT")
    private String clusterName;

    @ApiModelProperty(value = "实例所属服务名称，格式为: 组名@@服务名", example = "DEFAULT_GROUP@@my-service")
    private String serviceName;

    @ApiModelProperty(value = "实例元数据，包含自定义标签和配置信息")
    private Map<String, String> metadata;

    @ApiModelProperty(value = "实例心跳超时时间(毫秒)", example = "15000")
    private int instanceHeartBeatTimeOut;

    @ApiModelProperty(value = "实例IP删除超时时间(毫秒)", example = "30000")
    private int ipDeleteTimeout;

    @ApiModelProperty(value = "实例心跳间隔时间(毫秒)", example = "5000")
    private int instanceHeartBeatInterval;
}
